/* 
 * File:   uniofwork.hpp
 * Author: spuello
 *
 * Created on August 7, 2012, 2:56 PM
 */

#ifndef UNIOFWORK_HPP
#define	UNIOFWORK_HPP

#include "utilities.hpp"
#include "businesslogic.hpp"



using lms::utilities::Singleton;
using lms::bussinesslogic::BookServices;
using lms::bussinesslogic::CustomerServices;
using lms::bussinesslogic::OrderServices;



namespace lms {
  namespace unitofwork {

    class UnitOfWork : public Singleton< UnitOfWork > {
    private:

      friend class Singleton< UnitOfWork >;


      UnitOfWork();

      //      GenericRepository<lms::entities::Customer>* customerRepository;
      //      GenericRepository<lms::entities::Book>* bookRepository;

      GenericRepository<lms::entities::User>* userRepository;
      BookServices* bookServices;
      CustomerServices* customerServices;
      OrderServices* orderServices;

    public:
      using lms::utilities::Singleton< UnitOfWork >::getInstance;

      OrderServices* GetOrderServices();
      CustomerServices* GetCustomerServices();
      BookServices* GetBookServices();
      GenericRepository<lms::entities::User>* getUserRepository();

      //      GenericRepository<lms::entities::Customer>* getCustomerRepository();
      //      GenericRepository<lms::entities::Book>* getBookRepository();
    };
  }
}

#endif	/* UNIOFWORK_HPP */

